<?php

declare(strict_types=1);

namespace app\store\controller\tools;

use app\store\controller\Controller;
use app\store\service\tools\Cate as CateService;
use think\App;
use think\response\Json;

class Cate extends Controller
{

    private $CateService;
    public function __construct(App $app,CateService $CateService)
    {
        parent::__construct($app);
        $this->CateService = $CateService;

    }

    //分类列表
    public function index():Json
    {
        $params = $this->request->get();
        $this->validate(
            $params,
            [
                'page' => 'integer',
                'limit' => 'integer'
            ]
        );
        $list = $this->CateService->getList($params);
        return $this->renderSuccess(compact('list'));

    }





}